package jihyun51.swing;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;

public class Border_Layout extends JDialog {

	private final JPanel contentPanel = new JPanel();

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		try {
			Border_Layout dialog = new Border_Layout();
			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			dialog.setVisible(true);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Create the dialog.
	 */
	public Border_Layout() {
		setTitle("Border_Layout");
		setBounds(100, 100, 640, 480);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		contentPanel.setLayout(new BorderLayout(5, 5));
		{
			JPanel top = new JPanel();
			contentPanel.add(top, BorderLayout.NORTH);
			{
				JLabel lblNewLabel = new JLabel("New label");
				top.add(lblNewLabel);
			}
		}
		{
			JPanel left = new JPanel();
			contentPanel.add(left, BorderLayout.WEST);
			{
				JButton btnNewButton = new JButton("New button");
				left.add(btnNewButton);
			}
		}
		{
			JPanel bottom = new JPanel();
			contentPanel.add(bottom, BorderLayout.SOUTH);
			{
				JButton btnNewButton_2 = new JButton("New button");
				bottom.add(btnNewButton_2);
			}
		}
		{
			JPanel right = new JPanel();
			contentPanel.add(right, BorderLayout.EAST);
			{
				JButton btnNewButton_1 = new JButton("New button");
				right.add(btnNewButton_1);
			}
		}
		{
			JPanel ceenter = new JPanel();
			contentPanel.add(ceenter, BorderLayout.CENTER);
			{
				JButton btnNewButton_3 = new JButton("New button");
				ceenter.add(btnNewButton_3);
			}
		}
		{
			JPanel buttonPane = new JPanel();
			buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
			getContentPane().add(buttonPane, BorderLayout.SOUTH);
			{
				JButton okButton = new JButton(" 확인 ");
				okButton.setActionCommand("OK");
				buttonPane.add(okButton);
				getRootPane().setDefaultButton(okButton);
			}
		}
	}

}
